<template>
  <div>
    <el-row type="flex" align="middle" justify="center" style="margin-top: 50px">
      <el-col :span="12">
        <formCreate :rule="rule" :option="option" @submit="submit" />
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import { processDefinitionKey } from '@/api/oaProcessTemplate'
  export default {
    name: 'ProcessDefinition',
    data() {
      return {
        rule: [],
        option: {}
      }
    },
    created() {
      this.getForm()
    },
    methods: {
      async getForm() {
        const { formRule, formOption } = await processDefinitionKey(this.$route.query.processDefinitionKey)
        this.rule = JSON.parse(formRule)
        this.option = JSON.parse(formOption)
      },
      submit(formData) {
        console.log('需要提交的数据是', formData)
      }
    }
  }
</script>

<style></style>
